home *** CD-ROM | disk | FTP | other *** search
-
- String++ Revision History
-
- Copyright (c)1993 by Carl Moreland
- 02/16/93
-
- -----------------------------------------------------------------------
-
- Version 2.12
-
- - Fixed bug in the Copy() function. Copy() will allocate memory for the
- char* and therefore should be passed an uninitialized pointer:
-
- char *p;
- s1.Copy(p); // allocates memory for p & copies s1 to it
-
- - split() is now called with just the array name instead of an address
- to the array:
-
- string *array;
- n = split(str1, &array, " "); // Old way
- n = split(str1, array, " "); // New way
-
- Memory for array is still allocated within the split function.
-
- - A cast operator has been added. This allows a string instance to be
- passed where a char* is expected. Previously, you had to use the ()
- operator or the ptr() function to return the char* contents of a
- string:
-
- string s = "Hello";
- char p[6];
-
- strcpy(p,s()); // old way
- strcpy(p, s); // new way
-
- The cast operator returns a const char* just like the () operator.
-
- - Added Zortech C++ support (Stephen Kawamoto)
-
- -----------------------------------------------------------------------
-
- Version 2.11
-
- - Fixed bug in int constructor.
-
- -----------------------------------------------------------------------
-
- Version 2.10
-
- - Derived class String from class string for those who prefer the capi-
- talized spelling.
-
- - Minor documentation changes
-
- -----------------------------------------------------------------------
-
- Version 2.01
-
- - Minor bug fixes
-
- -----------------------------------------------------------------------
-
- Version 2.0
-
- - Added iostream support.
-
- - Enhanced [] operator can now assign individual characters.
-
- - Comparison functions are now implemented as inline.
-
- - New general functions:
-
- Insert() inserts text in str
- Delete() deletes a substring of str
- Copy() copies str to a non-const char*
- Trim() trims leading or trailing multiple chars from str.
- Value() returns the numeric value (int or long) of str.
-
- - Existing methods have been renamed to begin with an uppercase letter,
- such as string::justify() -> string::Justify(). The older naming con-
- ventions are still supported for backwards compatibility. Most member
- methods now operate directly on the string itself instead of returning
- a new string. For example, str1.Justify() will modify str1 instead of
- creating a new string. C-style function names remain all lower-case
- and return newly created strings, so str2 = justify(str1, LEFT, 80)
- will not modify str1.
-
- - AWK functions are also implemented as member methods that directly
- modify the string object. These versions begin with an uppercase.
-
- - Constructors and = operators added for int & long data types. New
- function Value() returns the numeric value of a string.
-
- - The () operator continues to return a const char* to the string
- object's data, but the ptr() method now returns a non-const char*.
- Therefore, if you need to pass a string's contents to a C-style func-
- tion that wants a non-const char*, use ptr():
-
- Old way:
-
- strupr((char *)s1()); // strupr() wants to modify s1 directly
- // so s1 must be cast as non-const
- New way:
-
- strupr(s1.ptr()); // s1.ptr() is now non-const
-
- Returning a non-const char* completely strips the inherent protection
- that the string class offers and can be very dangerous. Use this with
- caution.
-
- -----------------------------------------------------------------------
-
- Version 1.1
-
- - Bug fixes, mostly memory leaks.
-
- - Rewrote several functions for improved efficiency.
-
- - Improved demo program.
-
- - gsub() is generalized with the inclusion of a num parameter.
-
- - New justify() function.
-
- - New operators * and *=.
-
- -----------------------------------------------------------------------
-
- Version 1.0
-
- - Initial release.
-
- -----------------------------------------------------------------------
-
- Comments, suggestions, and bug reports are welcomed. Send them to me
- via Internet (carl.moreland@analog.com), CompuServe (72137,2657), or
- mail them to:
-
- Carl Moreland
- 4314 Filmore Rd
- Greensboro, NC 27409
-
- The latest version of this software can be found on CompuServe in the
- Borland C++ forum (GO BCPPDOS, Lib 6) or on Internet in the Simtel20
- archives (oak.oakland.edu or ftp.uu.net).
-